package com.tanhua.server.exceptions;

import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;

@ControllerAdvice
public class BasicExceptionAdvice {

    @ExceptionHandler(value = TanhuaException.class)
    public ResponseEntity handlerException(TanhuaException e){
        e.getStackTrace();
        System.out.println("已经进入到了统一异常处理中............");
        return ResponseEntity.status(e.getStatusCode()).body(e.getMessage());
    }
}
